package ces.lawsuit.model;

import com.jfinal.plugin.activerecord.Page;

public class Param extends BaseModel<Param> {
	public static final Param me = new Param();
	public static final String PARENT_PARAM_SQL="SELECT *   FROM T_PARAM WHERE PARENTMENU IS NULL ORDER BY SORT ";
	public static final String ALL_ITEM_MENU_SQL="SELECT *  FROM  T_PARAM WHERE PARENTMENU IS NOT NULL ORDER BY PARENTMENU,SORT";
	public static final String LIST_SQL="SELECT *   FROM T_PARAM ORDER BY SORT ASC";
	public static final String PARENT_LIST_SQL="SELECT *  FROM  T_PARAM T WHERE T.PARENTMENU IS NULL AND ID!=? ORDER BY SORT";
	public static final String PAGINATE_SQL="FROM (SELECT T.*,B.NAME PNAME FROM T_PARAM T LEFT JOIN T_PARAM B B.ID=T.PMENU)";
	public static final String BATCH_DELETE_SQL = "DELETE FROM T_PARAM WHERE ID IN(?)";
	public Page<Param> paginate(int pageNumber, int pageSize) {
		return paginate(pageNumber, pageSize, "SELECT *", "FROM T_PARAM ORDER BY SORT ASC");
	}
}
